#!/usr/bin/env python

def _(s): return s

import sys, wx

class Open:
    def __init__(self, mainWin):
        dir = "/etc/apache2/"
        wildcard = "All files (*.*)|*.*|"\
                   "Apache config (*.conf)|*.conf"
        file = "apache2.conf"
        dlg = wx.FileDialog(mainWin, message=_("Choose a file"),
                    defaultDir=dir, defaultFile=file,
                    wildcard=wildcard, style=wx.OPEN | wx.CHANGE_DIR)
        dlg.SetFilterIndex(1)
        if dlg.ShowModal() == wx.ID_OK:
            mainWin.loadInfo(dlg.GetPaths()[0])